package com.ftj.pmp.controller;

import com.ftj.pmp.response.BaseResponse;
import com.ftj.pmp.response.StatusCode;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * Created by fengtj on 2021/6/29 0:18
 */
@Controller
@RequestMapping("/base")
public class BaseController {

    private static final Logger log = LoggerFactory.getLogger(BaseController.class);

    /**
     * 第一个测试案例
     *
     * @param name
     * @return
     */
    @RequestMapping(value = "/info", method = RequestMethod.GET)
    @ResponseBody
    public BaseResponse info(String name, ModelMap modelMap) {
        BaseResponse baseResponse = new BaseResponse(StatusCode.Success);
        if (StringUtils.isBlank(name)) {
            name = "权限管理平台";
        }
        baseResponse.setData(name);
        return baseResponse;
    }
}
